# -*- coding: utf-8 -*-
"""
Created on Wed Oct 28 14:33:08 2020

@author: Administrator
"""
#一张卡牌
class CardNode(object):
    
    #花色有heibao hongtao  fangpian meihua
    #现实和牌面值一样
    #value值和牌的大小相关，k是13，A是14，2是15，小王是16，大王是17
    HUASE_MEIHUA="meihua"
    HUASE_HONGTAO="hongtao"
    HUASE_HEITAO="heitao"
    HUASE_FANGKUAI="fangkuai"
    HUASE_QKING="king or quene"
    huasezhonglei=(HUASE_MEIHUA,HUASE_HEITAO,HUASE_HONGTAO,HUASE_FANGKUAI)
    xianshizhonglei=("3","4","5","6","7","8","9","10","J","Q","K","A","2")
    
    def __init__(self,huase:int,xianshi:str,value:int):
        self.huase=huase
        self.xianshi=xianshi
        self.value=value
        
        
    def __eq__(self,o):
        return self.value==o.value
    
 
class CardGame(object):
    
    def __init__(self):
        self.cardlink=[]  #新牌
        i=3
        for xs  in CardNode.xianshizhonglei:
            for  hs in CardNode.huasezhonglei:
                self.cardlink.append(CardNode(hs,xs,i))
            i=i+1
        queen=CardNode(CardNode.HUASE_QKING,"queen",16)
        king=CardNode(CardNode.HUASE_QKING,"king",17)
        self.cardlink.append(queen)
        self.cardlink.append(king)
        
    #洗牌
    def shuffle(self):
        import random
        random.shuffle (self.cardlink )
        
    #发牌，返回三个序列        
    def deal(self):
        return self.cardlink[0:17],self.cardlink[17:34],self.cardlink[34:54]
    
    def show(self):
        for cd in self.cardlink:
            print(cd.huase,"  ",cd.xianshi," ",cd.value)

k1=CardNode("H","2",14)
k2=CardNode("F","2",14)